package factory.pizzas;

import java.util.Objects;

/**
 * SimplePizzaFactory 创建Pizza
 * @author jacob
 * @Date 2020/12/19 00:40
 */
public class SimplePizzaFactory {

    public Pizza createPizza(PizzaType type){
        Pizza pizza = null;

        if (Objects.equals(type, PizzaType.CHEESE)){
            pizza = new CheesePizza();
        } else if (Objects.equals(type, PizzaType.PEPPERONI)){
            pizza = new PepperoniPizza();
        } else if (Objects.equals(type, PizzaType.CLAM)){
            pizza = new ClamPizza();
        }else if (Objects.equals(type, PizzaType.VEGGIE)){
            pizza = new VeggiePizza();
        }

        return  pizza;
    }



}
